<?php
/*
	管理端链接获取接口
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op']=='get'){
	$menu_name=$_RQ['menu_name'];
	if(!$menu_name){
		exi('参数错误，获取菜单数据失败！','error');
	}
	$menu_name=explode('.',$menu_name);
	$num=count($menu_name);
	if($num==1){
		$plugininfo=pdo_get('core_plugins',array('name'=>$menu_name['0']),array('is_legao','is_wxwork'));
		if($plugininfo['is_legao']){
			$menu_file=ROOT_PLUGIN.$menu_name['0'].'/model/menu.php';
			if(is_file($menu_file)){
				$menu=plugin($menu_name['0'])->menu();
				$menu=up_top_plugin_menu($menu,$menu_name['0']);
				if(!$plugininfo['is_wxwork'] && !$menu[0]['nodiy']){
					$menu[0]['child'][]=array('title'=>'DIY装修','child'=>array(
							array('url'=>'jy_diypage/index//basicname='.$menu_name['0'],'title'=>'页面列表'),
							array('url'=>'jy_diypage/diypage_template//basicname='.$menu_name['0'],'title'=>'模板市场'),
					));
				}
				if(!$menu[0]['noonesys']){
					$menu[0]['child'][0]['child'][]=array('url'=>'core/basic.onelinks/'.$menu_name['0'],'title'=>'独立登录链接');
					$menu[]=cfc('menus')->get_sitemenus($menu_name['0']);
				}
			}
		}
	}else{
		$method=$menu_name['1'];
		$menu=plugin($menu_name['0'])->$method();
	}
	$menu=check_menu($menu);
	exi($menu);
}